﻿using System;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Electrical;

namespace HYElectricSetting
{
	public class WireTypeData
	{
		public WireTypeData()
		{
			this.Name = string.Empty;
			this.WireMaterial = null;
			this.TemperatureRating = null;
			this.Insulation = null;
			this.MaxSize = null;
			this.NeutralMultiplier = 1.0;
			this.NeutralRequired = true;
			this.NeutralSize = 0;
			this.Conduit = null;
			this.Remark = string.Empty;
		}

		public WireTypeData(Autodesk.Revit.DB.Document doc, string name)
		{
			this.Name = name;
			this.WireMaterial = WireData.GetWireMaterialType(doc, "铜");
			this.TemperatureRating = WireData.GetTemperatureRating(this.WireMaterial, "60");
			this.Insulation = WireData.GetInsulationType(this.TemperatureRating, "BV");
			this.MaxSize = WireData.GetMaxWireSize(this.TemperatureRating);
			this.NeutralMultiplier = 1.0;
			this.NeutralRequired = true;
			this.NeutralSize = 0;
			this.Conduit = WireData.GetWireConduitType(doc);
			this.Remark = string.Empty;
		}

		public WireTypeData(WireTypeData other)
		{
			this.Name = other.Name;
			this.WireMaterial = other.WireMaterial;
			this.TemperatureRating = other.TemperatureRating;
			this.Insulation = other.Insulation;
			this.MaxSize = other.MaxSize;
			this.NeutralMultiplier = other.NeutralMultiplier;
			this.NeutralRequired = other.NeutralRequired;
			this.NeutralSize = other.NeutralSize;
			this.Conduit = other.Conduit;
			this.Remark = other.Remark;
		}

		public WireTypeData(WireType wt)
		{
			this.Name = wt.Name;
			this.WireMaterial = wt.WireMaterial;
			this.TemperatureRating = wt.TemperatureRating;
			this.Insulation = wt.Insulation;
			this.MaxSize = wt.MaxSize;
			this.NeutralMultiplier = wt.NeutralMultiplier;
			this.NeutralRequired = wt.NeutralRequired;
			this.NeutralSize = wt.NeutralSize;
			this.Conduit = wt.Conduit;
			this.Remark = string.Empty;
		}

		public string Name { get; set; }

		public WireMaterialType WireMaterial { get; set; }

		public TemperatureRatingType TemperatureRating { get; set; }

		public InsulationType Insulation { get; set; }

		public WireSize MaxSize { get; set; }

		public double NeutralMultiplier { get; set; }

		public bool NeutralRequired { get; set; }

		public NeutralMode NeutralSize { get; set; }

		public WireConduitType Conduit { get; set; }

		public string Remark { get; set; }
	}
}
